Client-side scripting has become a popular technique used by a large number of Web sites. As used herein, “client-side scripting” refers to a class of Web-based computer programs that are executed by a user's application executing on the user's computer system. Client-side scripts are often embedded within a document being processed by the user's application. Illustrative client-side applications include commercial browser applications and applications that have, embedded within them, browser-like functionality. Illustrative documents include, but are not limited to, HyperText Markup Language (HTML) documents, eXtensible Markup Language (XML) documents and other files containing scripts. During run-time, when the user's application encounters a script in a document it passes the script to a script engine. The script engine runs the script and returns a result value to the application. In practice, some client-side applications may have the ability to use multiple different script engines. In these cases when a script is encountered by the user's client-side application, it first determines what type of script it is and then passes the script to the appropriate script engine.
Illustrative scripting languages include, but are not limited to, JavaScript®, Jscript®, VBScript, XUL, XSLT and Perl. (JAVASCRIPT is a registered trademark of Sun Microsystems, Inc. JSCRIPT is a registered trademark of the Microsoft Corporation.) JavaScript is perhaps the most widely known and used client-side scripting language. It is so common in fact, that techniques involving the combination of an XML/HTML document and JavaScript scripts to improve a user's impression of application responsiveness have become significant enough to acquire a name: AJAX. AJAX scripts are sometimes very complex, spanning thousands to tens of thousands of lines of code. Such large scripts present a difficult debugging challenge. This is particularly true as the user's application and its associated script engines (within which the error occurs) operate in different contexts. It would therefore be beneficial to provide a technique to assist in the process of debugging/troubleshooting large and complex scripts intended for execution by a client-side application.